import request from '@/utils/request'

// 查询行业列表
export function listSysIndustry(query) {
  return request({
    url: '/industry/sysIndustry/list',
    method: 'get',
    params: query
  })
}

// 查询行业详细
export function getSysIndustry(id) {
  return request({
    url: '/industry/sysIndustry/' + id,
    method: 'get'
  })
}

// 保存行业
export function saveSysIndustry(data) {
  return request({
    url: '/industry/sysIndustry/save',
    method: 'post',
    data: data
  })
}

// 删除行业
export function delSysIndustry(id) {
  return request({
    url: '/industry/sysIndustry/' + id,
    method: 'delete'
  })
}

// 导出行业
export function exportSysIndustry(query) {
  return request({
    url: '/industry/sysIndustry/export',
    method: 'get',
    params: query
  })
}

// 获取下拉树列表
export function treeSelect(query) {
  return request({
    url: '/industry/sysIndustry/treeSelect',
    method: 'get',
    params: query
  })
}

// 根据一级行业ID，获取对应的二级行业集合
export function getSecondList(parentId) {
  return request({
    url: '/industry/sysIndustry/getSecondList/' + parentId,
    method: 'get'
  })
}

// 查询所有的一级行业集合
export function allFirstList() {
  return request({
    url: '/industry/sysIndustry/allFirstList',
    method: 'get'
  })
}

// 构建树
export function buildTree() {
  return request({
    url: '/industry/sysIndustry/buildTree',
    method: 'get'
  })
}

